﻿<%@ Page Title="Quản lí tỉnh thành" Language="C#" MasterPageFile="~/Views/MasterPageViews.master" AutoEventWireup="true"
    CodeFile="LocationProvinces.aspx.cs" Inherits="Views_LocationProvinces" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<asp:Content ID="ContentHeader" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="ContentChange" ContentPlaceHolderID="ContentPlaceHolderChange" runat="Server">
    <h3 class="header-title">
        <ext:Label StyleHtmlCls="lable-message" StyleHtmlContent="true" ID="lblHeader" runat="server" Text="Quản lý Tỉnh thành"
            Icon="ApplicationFormMagnify" />
    </h3>
    <div class="content-sub">
        <ext:Toolbar ID="ToolbarFunctions" runat="server">
            <Items>
                <ext:Button ID="btnAdd" runat="server" Text="Thêm mới" Icon="Add" OnDirectClick="btnAdd_DirectClick" />
                <ext:Button ID="btnEdit" runat="server" Text="Chỉnh sửa" Icon="Pencil" OnDirectClick="btnEdit_DirectClick" />
                <ext:Button ID="btnDelete" runat="server" Text="Xóa" Icon="Delete" OnDirectClick="btnDelete_DirectClick" />
            </Items>
        </ext:Toolbar>

        <!--Store for provice gridpanel-->
        <ext:Store
            ID="StoreProvince"
            runat="server"
            OnReadData="StoreProvince_ReadData"
            PageSize="30">
            <Sorters>
                <ext:DataSorter Direction="ASC" Property="NameOfProvince" />
            </Sorters>
            <Model>
                <ext:Model ID="ModelProvinces" runat="server" IDProperty="ProvID">
                    <Fields>
                        <ext:ModelField Name="ProvID" />
                        <ext:ModelField Name="NameOfProvince" />
                        <ext:ModelField Name="StatusOfProvince" Type="Boolean" />
                    </Fields>
                </ext:Model>
            </Model>
        </ext:Store>
        <!----------------->
        <!--Grid province-->

        <ext:Hidden ID="HiddenExport" runat="server" />
        <ext:GridPanel
            ID="GridPanelProvince"
            runat="server"
            StoreID="StoreProvince"
            Title="Danh sách tỉnh thành"
            Height="510"
            Split="true"
            AutoScroll="True"
            BodyStyle="background-image: url('../Themes/bg-main.png')">
            <ColumnModel ID="ColumnModelProvince" runat="server">
                <Columns>
                    <ext:RowNumbererColumn ID="RowNumbererColumnProvince" Width="30" Text="STT" runat="server" />
                    <ext:Column ID="Col_ID" runat="server" Text="Mã tỉnh thành" DataIndex="ProvID" Hidden="true" />
                    <ext:Column ID="Col_Name" runat="server" Text="Tỉnh thành" DataIndex="NameOfProvince" Flex="1" />
                    <ext:CheckColumn ID="Col_stt" runat="server" Text="Trạng thái" DataIndex="StatusOfProvince" />
                </Columns>
            </ColumnModel>
            <View>
                <ext:GridView ID="GridViewScoll" runat="server" StripeRows="true" TrackOver="true" />
            </View>
            <SelectionModel>
                <ext:RowSelectionModel ID="RowSelectionModelProv" runat="server" Mode="Single">
                    <DirectEvents>
                        <Select OnEvent="RowSelect" Buffer="250" />
                    </DirectEvents>
                </ext:RowSelectionModel>
            </SelectionModel>
            <BottomBar>
                <ext:PagingToolbar ID="PagingToolbarProvinces" runat="server" StoreID="StoreProvince" BeforePageText="Trang"
                    EmptyMsg="Chưa có dữ liệu" AfterPageText="trên  {0}"
                    DisplayMsg="Hiển thị bản ghi {0} - {1} trên tổng số {2}" RefreshText="Làm mới" LastText="Trang cuối"
                    NextText="Trang kế" PrevText="Trang trước" FirstText="Trang đầu" />
            </BottomBar>
        </ext:GridPanel>
        <!--------------------->

        <!-- Cửa sổ popup thêm tỉnh thành -->
        <ext:Window
            ID="windowAdd"
            runat="server"
            Title="Thêm mới tỉnh thành"
            Icon="Add"
            Height="175"
            Width="300"
            BodyStyle="background-color: #fff;"
            Modal="true"
            ShadowMode="Drop"
            Hidden="true">
            <Content>
                <ext:Toolbar ID="ToolbarAddProvinces" runat="server">
                    <Items>
                        <ext:Button ID="btnWdAddPro" runat="server" Text="Thêm mới" Icon="DiskBlack" OnDirectClick="btnWdAddPro_DirectClick" />
                        <ext:Button ID="btnWdCancelPro" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnWdCancelPro_DirectClick" />
                    </Items>
                </ext:Toolbar>
                <div class="content-popup-style">
                    <div class="view-msg-popup">
                        <ext:Label ID="lblwdAddProMes" runat="server" StyleHtmlContent="true" StyleHtmlCls="lable-message-error"
                            MarginSpec="5 0 5 0" />
                    </div>
                    <div>
                        <ext:TextField ID="txtProname" runat="server" FieldLabel="Tên tỉnh" LabelWidth="80" />
                        <ext:Checkbox ID="cbxWdAddStatus" runat="server" FieldLabel="Trạng thái" LabelWidth="80" BoxLabel="Cho phép hoạt động" />
                    </div>

                </div>
            </Content>
        </ext:Window>


        <!----------------------->
        <!-- Cửa sổ popup chỉnh sửa thông tin tỉnh thành -->
        <ext:Window
            ID="WindowUpdateProv"
            runat="server"
            Title="Chỉnh sửa thông tỉnh thành"
            Icon="Add"
            Height="200"
            Width="330"
            BodyStyle="background-color: #fff;"
            Modal="true"
            ShadowMode="Drop"
            Hidden="true">
            <Content>
                <ext:Toolbar ID="ToolbarWindowUpdateProvince" runat="server">
                    <Items>
                        <ext:Button ID="btnUpdateProv" runat="server" Text="Hoàn thành" Icon="Disk" OnDirectClick="btnUpdateProv_DirectClick" />
                        <ext:Button ID="btnCancelWDUpdateProv" runat="server" Text="Hủy bỏ" Icon="Delete" OnDirectClick="btnCancelWDUpdateProv_DirectClick" />
                    </Items>
                </ext:Toolbar>
                <div class="content-popup-style">
                    <div class="view-msg-popup">
                        <ext:Label ID="lblWDUpdateProMes" runat="server" StyleHtmlContent="true" StyleHtmlCls="lable-message-error"
                            MarginSpec="5 0 5 0" />
                    </div>
                    <div>
                        <ext:TextField ID="txtWDUpdateProName" runat="server" FieldLabel="Tên tỉnh hiện thời" LabelWidth="130"
                            Disabled="true"
                            MarginSpec="5 0 5 0" />
                        <ext:TextField ID="txtWDUpdateNewProname" runat="server" FieldLabel="Tên mới" LabelWidth="130" MarginSpec="5 0 5 0" />
                        <ext:Checkbox ID="checkWDUpdateStatus" runat="server" FieldLabel="Trạng thái" LabelWidth="130" BoxLabel="Cho phép hoạt động"
                            MarginSpec="5 0 5 0" />
                    </div>
                </div>
            </Content>
        </ext:Window>
        <!----------------------->
    </div>

    <div class="view-info-record">
        <h3 class="header-title">
            <ext:Label StyleHtmlCls="lable-message" StyleHtmlContent="true" ID="LabelViewInformations" runat="server"
                Text="Hiển thị thông tin"
                Icon="Information" />
        </h3>
        <div class="content-info">
            <table>
                <tr>
                    <td class="with-td-view-info">Tên tỉnh thành:</td>
                    <td>
                        <ext:Label ID="lblViewProName" runat="server" />
                    </td>
                </tr>
                <tr>
                    <td class="with-td-view-info">Trạng thái:</td>
                    <td>
                        <ext:Checkbox ID="checkViewProStatus" runat="server" />
                    </td>
                </tr>
            </table>
        </div>
    </div>

</asp:Content>
